package com.jspgou.cms.dao;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.jspgou.cms.entity.Order;
import com.jspgou.cms.entity.ShopPaymentorder;
import com.jspgou.common.hibernate3.Updater;
import com.jspgou.common.page.Pagination;

public interface OrderDao {
	
	public Pagination getPage(int pageNo, int pageSize);
	
	public Pagination getFcPage(Integer paymentStatus,Integer shippingStatus,Integer status,Long storeId,Long memberId,int pageNo, int pageSize);
	
//	public Pagination getPageForMember(Long memberId, int pageNo, int pageSize);
//
//	public Pagination getPageForMember1(Long memberId, int pageNo, int pageSize);
//	
//	public Pagination getPageForMember2(Long memberId, int pageNo, int pageSize);
//	
//	public Pagination getPageForMember3(Long memberId, int pageNo, int pageSize) ;
	
	public Pagination getPage(Long webId,Long memberId, Long storeId,Integer status,Boolean isRefunded,String code,Long source,
			String productName, String userName,Long paymentId, Long shippingId,Integer paymentStatus,
			Integer shippingStatus,Long discuss,Date startTime,Date endTime,Double startOrderTotal,Double endOrderTotal,
			int pageNo, int pageSize);
	
	public List<Order> getList(Long webId,Long memberId,Long storeId, Integer status,Integer paymentStatus,
			String productName,String userName,Long paymentId,Long shippingId, 
			Date startTime,Date endTime,Double startOrderTotal,Double endOrderTotal);

	public Order findById(Long id);
	
	public Order findByCode(String code);
	
	public Order findByTradeNo(String tradeNo);

	public Order save(Order bean);

	public Order updateByUpdater(Updater<Order> updater);

	public Order deleteById(Long id);
	
	public List<Object> getTotalOrder();
	
	/**
	 * 
	 * @param id  店铺id
	 * @return
	 */
	public List<Object> getStoreTotalOrder(Long id);
	
	public BigDecimal getMemberMoneyByYear(Long memberId);
	
	public Integer[] getOrderByMember(Long memberId);
	
	public Pagination getOrderByReturn(Long memberId,int pageNo,int pageSize);
	//添加方法，根据订单状态获取所有订单
	public List<Order> getCountByStatus(Date startTime,Date endTime,Integer status);
	//根据总订单，查出副订单
	public List<Order> getPaymentOrder(ShopPaymentorder shopPaymentorder);
	
	public List<Order> getStatisticByYear(Integer year,Integer status);
	
    public List<Order> getList1(Long[]memberId);
    
    public List<Order> getlist(Date endDate);
	
}